<?php
declare (strict_types = 1);

namespace app\command;

use think\console\Command;
use think\console\Input;
use think\console\input\Argument;
use think\console\input\Option;
use think\console\Output;
use Dompdf\Dompdf;
use Dompdf\Options;
use think\facade\Db;

class TestInsert extends Command
{
    protected function configure()
    {
        // 指令配置
        $this->setName('test_insert')
            ->setDescription('the test command');
    }

    protected function execute(Input $input, Output $output)
    {
//        $this->insert();
        $this->rq();
        // 指令输出
        $output->writeln('test');
    }
    public function rq(){
        for($i = 0;$i<1000;$i++){
            $rq = file_get_contents('http://127.0.0.1:8000/index.php/index/c');
            var_dump($rq);
        }

    }
    public function insert(){
        for($i = 1000001;$i<=5000000;$i++){
            $insertDataA = [
                'a_name'=>'a_'.$i,
                'b_id'=>$i
            ];
            $insertDataB = [
                'b_name'=>'b_'.$i,
                'a_id'=>$i
            ];
            Db::name('a')->insert($insertDataA);
            Db::name('b')->insert($insertDataB);
            var_dump($i);
        }
    }
}
